/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MaintLocals.java
 *
 * Created on 04-feb-2009, 9:27:18
 */
package gui;

import data.DataLocals;
import java.util.ArrayList;
import on.*;

/**
 *
 * @author Cristina Torres Garcia
 */
public class MaintLocals extends logic.ContentiPanel<Locals> {

    ArrayList<Clubs> clubs;

    /** Creates new form MaintLocals */
    public MaintLocals() {
        initComponents();
        clubs = new DataLocals().obtenerClub();
    }

    private String[] crearListaClubs() {
        String[] c = new String[clubs.size()];
        int i = 0;
        for (Clubs clubs1 : clubs) {
            c[i] = clubs1.getNombre();
            i++;
        }
        return c;
    }

    public void setContenido(Locals l) {
        this.JTFlocalsNombre.setText(l.getNombre() + "");
        this.JTFlocalsDireccion.setText(l.getDireccionLocal() + "");
        this.JTFlocalsPoblacion.setText(l.getPoblacion());
        this.JTFlocalsProvincia.setText(l.getProvincia());
        this.JTFlocalsTelefono.setText(l.getTelefono());
        this.JTFlocalsMovil.setText(l.getMovil());
        this.JTFlocalsFax.setText(l.getFax());
        this.JTFlocalsLargoLocal.setText(l.getLocalLargo());
        this.JTFlocalsAnchoLocal.setText(l.getLocalAncho());
        this.JTFlocalsAltoLocal.setText(l.getLocalAlto());
        this.JTFlocalsAltoTerreno.setText(l.getTerrenoAlto());
        this.JTFlocalsAnchoTerreno.setText(l.getTerrenoAncho());
        this.JTFlocalsLargoTerreno.setText(l.getTerrenoLargo());
        this.JTFlocalsColorSuelo.setText(l.getColorSuelo());
        this.JTFlocalsIluminacion.setText(l.getIluminacion());
        this.JTFlocalsEmail.setText(l.getEMail());
        this.JTFlocalsCP.setText(l.getCodigoPostal());
        this.JTFlocalsMarca.setText(l.getMarcaMesa());
        this.JTFlocalsColor.setText(l.getColorMesa());
        this.JTFlocalsColorPAredFondo.setText(l.getColorParedesFondo());
        this.JTFlocalsColorPardLateral.setText(l.getColorParedesLaterales());
        this.JTXFIdLocal.setText((String.valueOf(l.getId_local())));
        this.JTXFIdClub.setText(String.valueOf(l.getId_club()));
        this.JCBclubNombre.setModel(new javax.swing.DefaultComboBoxModel(crearListaClubs()));
        this.JCBclubNombre.setSelectedItem(l.getClubNombre());
    }

    public Locals getContenido() {
        Locals l = new Locals();
        l.setId_local(Integer.parseInt( this.JTXFIdLocal.getText()));
        //l.setId_club(Integer.parseInt(this.JTXFIdClub.getText()));
        l.setNombre(this.JTFlocalsNombre.getText());
        l.setDireccionLocal(this.JTFlocalsDireccion.getText());
        l.setPoblacion(this.JTFlocalsPoblacion.getText());
        l.setProvincia(this.JTFlocalsProvincia.getText());
        l.setTelefono(this.JTFlocalsTelefono.getText());
        l.setMovil(this.JTFlocalsMovil.getText());
        l.setFax(this.JTFlocalsFax.getText());
        l.setLocalLargo(this.JTFlocalsLargoLocal.getText());
        l.setLocalAncho(this.JTFlocalsAnchoLocal.getText());
        l.setLocalAlto(this.JTFlocalsAltoLocal.getText());
        l.setTerrenoAlto(this.JTFlocalsAltoTerreno.getText());
        l.setTerrenoLargo(this.JTFlocalsLargoTerreno.getText());
        l.setTerrenoAncho(this.JTFlocalsAnchoTerreno.getText());
        l.setColorSuelo(this.JTFlocalsColorSuelo.getText());
        l.setIluminacion(this.JTFlocalsIluminacion.getText());
        l.setCodigoPostal(this.JTFlocalsCP.getText());
        l.setEMail(this.JTFlocalsEmail.getText());
        l.setColorParedesLaterales(this.JTFlocalsColorPardLateral.getText());
        l.setColorParedesFondo(this.JTFlocalsColorPAredFondo.getText());
        l.setColorMesa(this.JTFlocalsColor.getText());
        l.setMarcaMesa(this.JTFlocalsMarca.getText());
        l.setId_club(this.JCBclubNombre.getSelectedIndex());
        return l;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JTPDatosLocal = new javax.swing.JTabbedPane();
        JPDatosLocal = new javax.swing.JPanel();
        JLlocalsNombre = new javax.swing.JLabel();
        JLlocalsDireccion = new javax.swing.JLabel();
        JLlocalsPoblacion = new javax.swing.JLabel();
        JLlocalsProvincia = new javax.swing.JLabel();
        JLlocalsTelefono = new javax.swing.JLabel();
        JTFlocalsProvincia = new javax.swing.JTextField();
        JLlocalsFax = new javax.swing.JLabel();
        JTFlocalsFax = new javax.swing.JTextField();
        JTFlocalsTelefono = new javax.swing.JTextField();
        JLlocalsMovil = new javax.swing.JLabel();
        JTFlocalsMovil = new javax.swing.JTextField();
        JTFlocalsNombre = new javax.swing.JTextField();
        JTFlocalsPoblacion = new javax.swing.JTextField();
        JLlocalsCP = new javax.swing.JLabel();
        JTFlocalsCP = new javax.swing.JTextField();
        JTFlocalsDireccion = new javax.swing.JTextField();
        JLlocalsemail = new javax.swing.JLabel();
        JTFlocalsEmail = new javax.swing.JTextField();
        JTXFIdLocal = new javax.swing.JTextField();
        JlbLocal = new javax.swing.JLabel();
        JlbClub = new javax.swing.JLabel();
        JTXFIdClub = new javax.swing.JTextField();
        JCBclubNombre = new javax.swing.JComboBox();
        JLbClubNombre = new javax.swing.JLabel();
        JPanelFisicoLocal = new javax.swing.JPanel();
        JPTierra = new javax.swing.JPanel();
        JLlocalsColorSuelo = new javax.swing.JLabel();
        JTFlocalsColorSuelo = new javax.swing.JTextField();
        JLlocalsColorPAredLAteral = new javax.swing.JLabel();
        JTFlocalsColorPardLateral = new javax.swing.JTextField();
        JTFlocalsColorPAredFondo = new javax.swing.JTextField();
        JLlocalsColorParedFondo = new javax.swing.JLabel();
        JLlocalsIlumicacion = new javax.swing.JLabel();
        JTFlocalsIluminacion = new javax.swing.JTextField();
        JPLocal1 = new javax.swing.JPanel();
        JLlocalsAnchoTerreno = new javax.swing.JLabel();
        JTFlocalsAnchoTerreno = new javax.swing.JTextField();
        JLlocalsAltoTerreno = new javax.swing.JLabel();
        JTFlocalsAltoTerreno = new javax.swing.JTextField();
        JLlocalsLargoTerreno = new javax.swing.JLabel();
        JTFlocalsLargoTerreno = new javax.swing.JTextField();
        JPLocal = new javax.swing.JPanel();
        JLlocalsAnchoLocal = new javax.swing.JLabel();
        JTFlocalsAnchoLocal = new javax.swing.JTextField();
        JLlocalsAltoLocal = new javax.swing.JLabel();
        JTFlocalsAltoLocal = new javax.swing.JTextField();
        JLlocalsLargoLocal = new javax.swing.JLabel();
        JTFlocalsLargoLocal = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        JTFlocalsMarca = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        JTFlocalsColor = new javax.swing.JTextField();

        JLlocalsNombre.setText("Nombre");

        JLlocalsDireccion.setText("Dirección");

        JLlocalsPoblacion.setText("Población");

        JLlocalsProvincia.setText("Provincia");

        JLlocalsTelefono.setText("Teléfono");

        JLlocalsFax.setText("Fax");

        JLlocalsMovil.setText("Movil");

        JLlocalsCP.setText("CP");

        JLlocalsemail.setText("Correo electronico");

        JlbLocal.setText("Local");

        JlbClub.setText("Club");

        JCBclubNombre.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        JCBclubNombre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JCBclubNombreActionPerformed(evt);
            }
        });

        JLbClubNombre.setText("Club");

        javax.swing.GroupLayout JPDatosLocalLayout = new javax.swing.GroupLayout(JPDatosLocal);
        JPDatosLocal.setLayout(JPDatosLocalLayout);
        JPDatosLocalLayout.setHorizontalGroup(
            JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPDatosLocalLayout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPDatosLocalLayout.createSequentialGroup()
                        .addGap(148, 148, 148)
                        .addComponent(JTFlocalsEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 256, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JPDatosLocalLayout.createSequentialGroup()
                        .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JLlocalsNombre)
                            .addComponent(JLlocalsTelefono)
                            .addComponent(JLlocalsPoblacion)
                            .addComponent(JLlocalsemail)
                            .addGroup(JPDatosLocalLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(JLlocalsDireccion)))
                        .addGap(6, 6, 6)
                        .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JTFlocalsDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(JPDatosLocalLayout.createSequentialGroup()
                                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(JPDatosLocalLayout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, JPDatosLocalLayout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(JTFlocalsPoblacion, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(JLlocalsCP)
                                                .addGap(18, 18, 18)
                                                .addComponent(JTFlocalsCP))
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, JPDatosLocalLayout.createSequentialGroup()
                                                .addComponent(JTFlocalsTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(JLlocalsMovil)
                                                .addGap(25, 25, 25)
                                                .addComponent(JTFlocalsMovil, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addComponent(JTFlocalsNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JLbClubNombre)
                                    .addComponent(JLlocalsFax)
                                    .addComponent(JLlocalsProvincia)
                                    .addComponent(JlbLocal))
                                .addGap(18, 18, 18)
                                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(JPDatosLocalLayout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addComponent(JCBclubNombre, 0, 98, Short.MAX_VALUE))
                                    .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(JTFlocalsFax)
                                        .addComponent(JTFlocalsProvincia)
                                        .addGroup(JPDatosLocalLayout.createSequentialGroup()
                                            .addComponent(JTXFIdLocal, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(JlbClub)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(JTXFIdClub, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))))))))
                .addContainerGap())
        );
        JPDatosLocalLayout.setVerticalGroup(
            JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPDatosLocalLayout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JlbLocal)
                    .addComponent(JTXFIdLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JlbClub)
                    .addComponent(JTXFIdClub, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLlocalsNombre)
                    .addComponent(JTFlocalsNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JCBclubNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLbClubNombre))
                .addGap(18, 18, 18)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsDireccion))
                .addGap(26, 26, 26)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLlocalsCP)
                    .addComponent(JTFlocalsCP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsProvincia)
                    .addComponent(JTFlocalsProvincia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsPoblacion)
                    .addComponent(JTFlocalsPoblacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsMovil)
                    .addComponent(JTFlocalsMovil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsFax)
                    .addComponent(JTFlocalsFax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsTelefono))
                .addGap(31, 31, 31)
                .addGroup(JPDatosLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsemail))
                .addContainerGap(157, Short.MAX_VALUE))
        );

        JTPDatosLocal.addTab("Datos Local", JPDatosLocal);

        JPTierra.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Colores e Iliminación ", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("sansserif", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N

        JLlocalsColorSuelo.setText("Color del suelo");

        JLlocalsColorPAredLAteral.setText("Color de a pared lateral");

        JLlocalsColorParedFondo.setText("Color de la pared del fondo");

        JLlocalsIlumicacion.setText("Ilumicación");

        javax.swing.GroupLayout JPTierraLayout = new javax.swing.GroupLayout(JPTierra);
        JPTierra.setLayout(JPTierraLayout);
        JPTierraLayout.setHorizontalGroup(
            JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPTierraLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JLlocalsColorPAredLAteral)
                    .addComponent(JLlocalsColorParedFondo))
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(JPTierraLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(JTFlocalsColorPardLateral, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE))
                    .addGroup(JPTierraLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JTFlocalsColorPAredFondo, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(JLlocalsIlumicacion)
                    .addComponent(JLlocalsColorSuelo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(JTFlocalsColorSuelo, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
                    .addComponent(JTFlocalsIluminacion, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE))
                .addContainerGap())
        );
        JPTierraLayout.setVerticalGroup(
            JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPTierraLayout.createSequentialGroup()
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(JLlocalsColorPAredLAteral)
                        .addComponent(JTFlocalsColorPardLateral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(JTFlocalsColorSuelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(JLlocalsColorSuelo)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTFlocalsIluminacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(JPTierraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(JLlocalsColorParedFondo)
                        .addComponent(JTFlocalsColorPAredFondo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(JLlocalsIlumicacion)))
                .addContainerGap())
        );

        JPLocal1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Terreno de juego", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("sansserif", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N

        JLlocalsAnchoTerreno.setText("Ancho");

        JLlocalsAltoTerreno.setText("Alto");

        JLlocalsLargoTerreno.setText("Largo");

        javax.swing.GroupLayout JPLocal1Layout = new javax.swing.GroupLayout(JPLocal1);
        JPLocal1.setLayout(JPLocal1Layout);
        JPLocal1Layout.setHorizontalGroup(
            JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPLocal1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JLlocalsAnchoTerreno)
                    .addGroup(JPLocal1Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(JLlocalsAltoTerreno))
                    .addComponent(JLlocalsLargoTerreno))
                .addGap(28, 28, 28)
                .addGroup(JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(JTFlocalsLargoTerreno)
                    .addComponent(JTFlocalsAltoTerreno, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTFlocalsAnchoTerreno, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        JPLocal1Layout.setVerticalGroup(
            JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPLocal1Layout.createSequentialGroup()
                .addGroup(JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLlocalsAnchoTerreno)
                    .addComponent(JTFlocalsAnchoTerreno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLlocalsAltoTerreno)
                    .addComponent(JTFlocalsAltoTerreno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPLocal1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsLargoTerreno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsLargoTerreno))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        JPLocal.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Local", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP, new java.awt.Font("sansserif", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N

        JLlocalsAnchoLocal.setText("Ancho");

        JLlocalsAltoLocal.setText("Alto");

        JLlocalsLargoLocal.setText("Largo");

        javax.swing.GroupLayout JPLocalLayout = new javax.swing.GroupLayout(JPLocal);
        JPLocal.setLayout(JPLocalLayout);
        JPLocalLayout.setHorizontalGroup(
            JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPLocalLayout.createSequentialGroup()
                .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPLocalLayout.createSequentialGroup()
                        .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JLlocalsAnchoLocal)
                            .addGroup(JPLocalLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(JLlocalsAltoLocal)))
                        .addGap(38, 38, 38)
                        .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(JTFlocalsAltoLocal)
                            .addComponent(JTFlocalsAnchoLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)))
                    .addGroup(JPLocalLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(JLlocalsLargoLocal)
                        .addGap(34, 34, 34)
                        .addComponent(JTFlocalsLargoLocal, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        JPLocalLayout.setVerticalGroup(
            JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPLocalLayout.createSequentialGroup()
                .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsAnchoLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsAnchoLocal))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLlocalsAltoLocal)
                    .addComponent(JTFlocalsAltoLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFlocalsLargoLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLlocalsLargoLocal)))
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Mesas"));

        jLabel2.setText("Marca");

        jLabel3.setText("Color");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(JTFlocalsMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(JTFlocalsColor, javax.swing.GroupLayout.DEFAULT_SIZE, 47, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(JTFlocalsMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(JTFlocalsColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout JPanelFisicoLocalLayout = new javax.swing.GroupLayout(JPanelFisicoLocal);
        JPanelFisicoLocal.setLayout(JPanelFisicoLocalLayout);
        JPanelFisicoLocalLayout.setHorizontalGroup(
            JPanelFisicoLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, JPanelFisicoLocalLayout.createSequentialGroup()
                .addContainerGap(14, Short.MAX_VALUE)
                .addGroup(JPanelFisicoLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, JPanelFisicoLocalLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(JPLocal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(JPLocal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(JPTierra, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        JPanelFisicoLocalLayout.setVerticalGroup(
            JPanelFisicoLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JPanelFisicoLocalLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JPTierra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JPanelFisicoLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JPanelFisicoLocalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(JPLocal, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(JPLocal1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(166, 166, 166))
        );

        JTPDatosLocal.addTab("Datos físicos del Local", JPanelFisicoLocal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JTPDatosLocal, javax.swing.GroupLayout.PREFERRED_SIZE, 542, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JTPDatosLocal)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void JCBclubNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JCBclubNombreActionPerformed
        // TODO add your handling code here:
        int indice = JCBclubNombre.getSelectedIndex();
        int idClub = clubs.get(indice).getId_Clubs();
        JTXFIdClub.setText("" + idClub);
    }//GEN-LAST:event_JCBclubNombreActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox JCBclubNombre;
    private javax.swing.JLabel JLbClubNombre;
    private javax.swing.JLabel JLlocalsAltoLocal;
    private javax.swing.JLabel JLlocalsAltoTerreno;
    private javax.swing.JLabel JLlocalsAnchoLocal;
    private javax.swing.JLabel JLlocalsAnchoTerreno;
    private javax.swing.JLabel JLlocalsCP;
    private javax.swing.JLabel JLlocalsColorPAredLAteral;
    private javax.swing.JLabel JLlocalsColorParedFondo;
    private javax.swing.JLabel JLlocalsColorSuelo;
    private javax.swing.JLabel JLlocalsDireccion;
    private javax.swing.JLabel JLlocalsFax;
    private javax.swing.JLabel JLlocalsIlumicacion;
    private javax.swing.JLabel JLlocalsLargoLocal;
    private javax.swing.JLabel JLlocalsLargoTerreno;
    private javax.swing.JLabel JLlocalsMovil;
    private javax.swing.JLabel JLlocalsNombre;
    private javax.swing.JLabel JLlocalsPoblacion;
    private javax.swing.JLabel JLlocalsProvincia;
    private javax.swing.JLabel JLlocalsTelefono;
    private javax.swing.JLabel JLlocalsemail;
    private javax.swing.JPanel JPDatosLocal;
    private javax.swing.JPanel JPLocal;
    private javax.swing.JPanel JPLocal1;
    private javax.swing.JPanel JPTierra;
    private javax.swing.JPanel JPanelFisicoLocal;
    private javax.swing.JTextField JTFlocalsAltoLocal;
    private javax.swing.JTextField JTFlocalsAltoTerreno;
    private javax.swing.JTextField JTFlocalsAnchoLocal;
    private javax.swing.JTextField JTFlocalsAnchoTerreno;
    private javax.swing.JTextField JTFlocalsCP;
    private javax.swing.JTextField JTFlocalsColor;
    private javax.swing.JTextField JTFlocalsColorPAredFondo;
    private javax.swing.JTextField JTFlocalsColorPardLateral;
    private javax.swing.JTextField JTFlocalsColorSuelo;
    private javax.swing.JTextField JTFlocalsDireccion;
    private javax.swing.JTextField JTFlocalsEmail;
    private javax.swing.JTextField JTFlocalsFax;
    private javax.swing.JTextField JTFlocalsIluminacion;
    private javax.swing.JTextField JTFlocalsLargoLocal;
    private javax.swing.JTextField JTFlocalsLargoTerreno;
    private javax.swing.JTextField JTFlocalsMarca;
    private javax.swing.JTextField JTFlocalsMovil;
    private javax.swing.JTextField JTFlocalsNombre;
    private javax.swing.JTextField JTFlocalsPoblacion;
    private javax.swing.JTextField JTFlocalsProvincia;
    private javax.swing.JTextField JTFlocalsTelefono;
    private javax.swing.JTabbedPane JTPDatosLocal;
    private javax.swing.JTextField JTXFIdClub;
    private javax.swing.JTextField JTXFIdLocal;
    private javax.swing.JLabel JlbClub;
    private javax.swing.JLabel JlbLocal;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

    @Override
    public void enableTextFields(boolean boo) {
         this.JTXFIdClub.setEnabled(false);
        this.JTXFIdLocal.setEnabled(false);
        this.JTFlocalsNombre.setEnabled(boo);
        this.JTFlocalsDireccion.setEnabled(boo);
        this.JTFlocalsPoblacion.setEnabled(boo);
        this.JTFlocalsCP.setEnabled(boo);
        this.JTFlocalsProvincia.setEnabled(boo);
        this.JTFlocalsTelefono.setEnabled(boo);
        this.JTFlocalsMovil.setEnabled(boo);
        this.JTFlocalsFax.setEnabled(boo);
        this.JTFlocalsEmail.setEnabled(boo);
        this.JTFlocalsColorPAredFondo.setEnabled(boo);
        this.JTFlocalsColorPardLateral.setEnabled(boo);
        this.JTFlocalsLargoLocal.setEnabled(boo);
        this.JTFlocalsAnchoLocal.setEnabled(boo);
        this.JTFlocalsAltoLocal.setEnabled(boo);
        this.JTFlocalsAltoTerreno.setEnabled(boo);
        this.JTFlocalsAnchoTerreno.setEnabled(boo);
        this.JTFlocalsLargoTerreno.setEnabled(boo);
        this.JTFlocalsColorSuelo.setEnabled(boo);
        this.JTFlocalsIluminacion.setEnabled(boo);
        this.JTFlocalsColor.setEnabled(boo);
        this.JTFlocalsMarca.setEnabled(boo);
        this.JCBclubNombre.setEnabled(boo);
    }

    @Override
    public void clearTextFields() {

        this.JTXFIdLocal.setText("");
        this.JTXFIdClub.setText("");
        this.JTFlocalsNombre.setText("");
        this.JTFlocalsDireccion.setText("");
        this.JTFlocalsPoblacion.setText("");
        this.JTFlocalsCP.setText("");
        this.JTFlocalsProvincia.setText("");
        this.JTFlocalsTelefono.setText("");
        this.JTFlocalsMovil.setText("");
        this.JTFlocalsFax.setText("");
        this.JTFlocalsEmail.setText("");
        this.JTFlocalsColorPAredFondo.setText("");
        this.JTFlocalsColorPardLateral.setText("");
        this.JTFlocalsLargoLocal.setText("");
        this.JTFlocalsAnchoLocal.setText("");
        this.JTFlocalsAltoLocal.setText("");
        this.JTFlocalsAltoTerreno.setText("");
        this.JTFlocalsAnchoTerreno.setText("");
        this.JTFlocalsLargoTerreno.setText("");
        this.JTFlocalsColorSuelo.setText("");
        this.JTFlocalsIluminacion.setText("");
        this.JTFlocalsColor.setText("");
        this.JTFlocalsMarca.setText("");
        this.JCBclubNombre.setModel(new javax.swing.DefaultComboBoxModel(crearListaClubs()));

    }
}
